package com.ehome.poct.base.device.service;

import com.ehome.core.page.Page;
import com.ehome.core.service.AbstractCrudServiceImpl;
import com.ehome.poct.base.api.dto.device.TestDeviceQrcodePrintHisHeadDTO;
import com.ehome.poct.base.api.virtual.TestDeviceQrcodePrintHisHeadService;
import com.ehome.poct.base.api.vo.device.QrcodePrintHisPageVO;
import com.ehome.poct.base.api.vo.device.QrcodePrintHisVO;
import com.ehome.poct.base.device.repository.TestDeviceQrcodePrintHisHeadRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * 扫码打印头表SerivceImlp
 *
 * @author ehome
 * @Date 2022-07-14 15:52
 */
@Service
public class TestDeviceQrcodePrintHisHeadServiceImpl extends AbstractCrudServiceImpl<TestDeviceQrcodePrintHisHeadDTO> implements TestDeviceQrcodePrintHisHeadService {

    @Autowired
    private TestDeviceQrcodePrintHisHeadRepository headRepository;

    @Override
    public QrcodePrintHisPageVO getList(Integer pageIndex, Integer pageSize) {
         Page<QrcodePrintHisVO>  patadatas = headRepository.pageList(pageIndex,pageSize);
        QrcodePrintHisPageVO datas =new QrcodePrintHisPageVO();
        datas.setCount(patadatas.getTotal());
        datas.setData(patadatas.getList());
        return datas;
    }
}